#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;
using ll = long long;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 1e6 + 10;
const int mod = 1e9 + 7;

char s[N];
int f[30], tt, tot, n;

int upd(int x) { return x + (x >> 31 & mod); }

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	scanf("%s", s + 1); n = strlen(s + 1);
	tt = 1;
	rep(i, 1, n) {
		if(i > 1) tt = tt * 2ll % mod; tot = tt; rep(j, 0, 25) tot = upd(tot + f[j] - mod);
		rep(j, 0, 25) if(j != (s[i] - 'a')) f[j] = 2ll * f[j] % mod;
		f[s[i] - 'a'] = upd(f[s[i] - 'a'] + tot - mod);
		//f[s[i] - 'a'] = tot;
	}
	tot = 0;
	rep(j, 0, 25) tot = upd(tot + f[j] - mod);
	cout << tot << endl; return 0;
}
